<template>
<div>
  <el-table
    :data="tableData"
    stripe
    style="width: 100%">
    <el-table-column
      prop="id"
      label="编号"
      width="180">
    </el-table-column>
    <el-table-column
      prop="name"
      label="姓名"
      width="180">
    </el-table-column>
    <el-table-column
      prop="state"
      label="状态"
      width="180">
      <template slot-scope="scope">
        <span v-if="scope.row.state == 0">未发货</span>
        <span v-if="scope.row.state == 1">已发货</span>
        <span v-if="scope.row.state == 3">确认收货</span>
        <span v-if="scope.row.state == 4">退货申请中</span>
        <span v-if="scope.row.state == 5">已退货</span>
      </template>
    </el-table-column>
    <el-table-column
      prop="parcelid"
      label="快递单编号"
      width="180">
    </el-table-column>
    <el-table-column
      prop="time"
      label="创建时间"
      width="180">
    </el-table-column>
    <el-table-column
      prop="price"
      label="支付总金额"
      width="180">
    </el-table-column>
    <el-table-column
      prop="date"
      label="支付时间"
      width="180">
    </el-table-column>
    <el-table-column
      prop="province"
      label="省"
      width="180">
    </el-table-column>
    <el-table-column
      prop="city"
      label="市"
      width="180">
    </el-table-column>
    <el-table-column
      prop="district"
      label="区/县"
      width="180">
    </el-table-column>
    <el-table-column
      prop="address"
      label="详细地址"
      width="180">
    </el-table-column>
    <el-table-column
      prop="namea"
      label="图书名字"
      width="180">
    </el-table-column>
  </el-table>
  <el-pagination
    small
    layout="prev, pager, next"
    :page-size="pageSize"
    :total="total" @current-change="page">
  </el-pagination>

</div>
</template>

<script>
export default {
  name: "Allorders",
  data(){
    return{
      total: 0,
      pageSize: 6,
      tableData: []
    }
  },
  created() {
    this.find()
  },
  methods:{
    find(){
      this.$http.post("backservice/forder/findpage2?pageNum=0&pageSize=" + this.pageSize).then(response => {
        console.log(response.userList)
        this.tableData = response.userList
        this.total = response.TotalNum
      })
    },
    page(currentPage) {
      this.$http.post('backservice/forder/findpage2?&pageNum=' + (currentPage - 1) + '&pageSize=' + this.pageSize)
        .then(response => {
          this.tableData = response.userList
        })
    },
  }
}
</script>

<style scoped>

</style>
